home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Language/OS - Multiplatform Resource Library
/
LANGUAGE OS.iso
/
p4
/
p4-1_2b.lha
/
p4-1.2b
/
messages_f
/
sr1_slave.f
< prev
Wrap
Text File
|
1993-02-05
|
1KB
|
56 lines
subroutine fslave()
include 'p4f.h'
character*500 buffer
integer type, from, next, done, procid, length
integer numsl, retcde, recvlen
integer TAGCNT, TAGDAT, TAGEND
parameter (TAGCNT = 10)
parameter (TAGDAT = 20)
parameter (TAGEND = 30)
numsl = p4ntotids() - 1
procid = p4myid()
print 200,'slave ',procid,' has started'
200 format(a,i2,a,/)
call p4flush()
if (procid .eq. 1) then
next = 0
else
next = procid - 1
endif
print 201,'slave ',procid,' next = ',next
201 format(a,i2,a,i2,/)
call p4flush()
length = 0
from = -1
type = TAGCNT
call p4recv(type,from,buffer,length,recvlen,retcde)
done = 0
50 if (done .ne. 0) goto 100
buffer = ' '
length = 500
from = -1
type = -1
call p4recv(type,from,buffer,length,recvlen,retcde)
if (type .eq. TAGEND) then
done = 1
else
print *,'SLAVE ',procid,' sending msg to ',next
call p4flush()
call p4send(TAGDAT,next,buffer,recvlen,retcde)
endif
goto 50
100 continue
end